//index.js
const app = getApp()
Page({
  data:{
      animation:"",
      countDown: '00分00秒',  // 定义初始展示的时间
      canIUse:wx.canIUse('button.open-type.getUserInfo'),
     
  },
  onShow: function() {
    console.log('index---------onShow()')
      this.animation = wx.createAnimation({
      duration: 1400,
      timingFunction: 'linear', // "linear","ease","ease-in","ease-in-out","ease-out","step-start","step-end"
      delay: 0,
      transformOrigin: '50% 50% 0',
      success: function(res) {
        console.log("res")
      }
    })
    var n = 0,
    that = this;
  this.interval = setInterval(function () {
          n++;
          that.rotateAni(n);
  }, 1400);
 


  },
rotateAni: function (n) {
    console.log("rotate=="+n)
    this.animation.rotate(180*(n)).step()
    this.setData({
      animation: this.animation.export()
    })
},
onLoad:function(){
wx.playBackgroundAudio({
  dataUrl: ' http://music.163.com/song/media/outer/url?id=1445228560',
title: '',
coverImgUrl: '../../images/music.png',
}),
wx.getSetting({
  success:function(res){
    if(res.authSetting['scope.userInfo'])
    wx.getUserInfo({success:function(res){
      console.log(res.userInfo)
    }
})
}
})
}, 
      })

